package com.hzsai.utils;

/**
 * hzsai 2019/8/22
 * usage:
 **/
public class OSInfo {

    private static final String OS = System.getProperty("os.name").toLowerCase();

    private static final String HOMEPATH = System.getProperty("user.home");

    private OSInfo(){}

    public static boolean isWindows() {
        return OS.indexOf("windows") >= 0;
    }

    public static String getHomePath() {
        return HOMEPATH;
    }

    public static String getTempPath() {
        // 返回是/tmp/形式的，注意最后面有/
        return System.getProperty("java.io.tmpdir").concat(isWindows() ? "" : "/");
    }
}
